using System.ComponentModel.DataAnnotations;

namespace GroupSix.Application.Dtos;

/// <summary>
/// 文件上传请求DTO
/// </summary>
public class FileUploadRequestDto
{
    /// <summary>
    /// 文件类型（avatar, document, image等）
    /// </summary>
    [Required(ErrorMessage = "文件类型不能为空")]
    public string FileType { get; set; } = string.Empty;

    /// <summary>
    /// 业务模块（user, role, menu等）
    /// </summary>
    [Required(ErrorMessage = "业务模块不能为空")]
    public string BusinessModule { get; set; } = string.Empty;

    /// <summary>
    /// 业务ID
    /// </summary>
    public Guid? BusinessId { get; set; }

    /// <summary>
    /// 文件描述
    /// </summary>
    public string? Description { get; set; }
}

/// <summary>
/// 文件上传响应DTO
/// </summary>
public class FileUploadResponseDto
{
    /// <summary>
    /// 文件ID
    /// </summary>
    public Guid FileId { get; set; }
    /// <summary>
    /// 文件名
    /// </summary>
    public string FileName { get; set; } = string.Empty;
    /// <summary>
    /// 文件访问URL
    /// </summary>
    public string FileUrl { get; set; } = string.Empty;
    /// <summary>
    /// 文件类型
    /// </summary>
    public string FileType { get; set; } = string.Empty;
    /// <summary>
    /// 业务模块
    /// </summary>
    public string BusinessModule { get; set; } = string.Empty;
    /// <summary>
    /// 业务ID
    /// </summary>
    public Guid? BusinessId { get; set; }
    /// <summary>
    /// 文件描述
    /// </summary>
    public string? Description { get; set; }
    /// <summary>
    /// 文件大小（字节）
    /// </summary>
    public long FileSize { get; set; }
    /// <summary>
    /// 文件哈希值
    /// </summary>
    public string FileHash { get; set; } = string.Empty;
    /// <summary>
    /// 上传时间
    /// </summary>
    public DateTime UploadedAt { get; set; }
}

/// <summary>
/// 头像上传请求DTO
/// </summary>
public class AvatarUploadRequestDto
{
    /// <summary>
    /// 用户ID
    /// </summary>
    [Required(ErrorMessage = "用户ID不能为空")]
    public Guid UserId { get; set; }

    /// <summary>
    /// 文件描述
    /// </summary>
    public string? Description { get; set; }
}

/// <summary>
/// 获取文件信息请求DTO
/// </summary>
public class GetFileInfoRequestDto
{
    /// <summary>
    /// 文件ID
    /// </summary>
    [Required(ErrorMessage = "文件ID不能为空")]
    public Guid FileId { get; set; }
}

/// <summary>
/// 删除文件请求DTO
/// </summary>
public class DeleteFileRequestDto
{
    /// <summary>
    /// 文件ID
    /// </summary>
    [Required(ErrorMessage = "文件ID不能为空")]
    public Guid FileId { get; set; }
}

/// <summary>
/// 文件信息DTO
/// </summary>
public class FileInfoDto
{
    /// <summary>
    /// 文件ID
    /// </summary>
    public Guid FileId { get; set; }

    /// <summary>
    /// 文件名
    /// </summary>
    public string FileName { get; set; } = string.Empty;

    /// <summary>
    /// 文件类型
    /// </summary>
    public string FileType { get; set; } = string.Empty;

    /// <summary>
    /// 文件大小（字节）
    /// </summary>
    public long FileSize { get; set; }

    /// <summary>
    /// 文件访问URL
    /// </summary>
    public string Url { get; set; } = string.Empty;

    /// <summary>
    /// 上传时间
    /// </summary>
    public DateTime UploadedAt { get; set; }
} 